﻿package mortal.game.view.market.buyAndQiugou
{
    import com.mui.controls.*;
    import fl.data.*;
    import flash.text.*;
    import mortal.common.*;
    import mortal.common.global.*;
    import mortal.component.GCatogeryList.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;

    public class MktCatogeryHead extends CatogeryListHeadBase
    {
        private var _btnBg:GLoadingButton;
        private var _txtExpandTitle:GTextFiled;
        private var _txtUnExpandTitle:GTextFiled;
        private var _titleText:String;

        public function MktCatogeryHead()
        {
            return;
        }// end function

        override public function expand() : void
        {
            this._btnBg.enabled = false;
            this._btnBg.mouseEnabled = true;
            super.isExpanding = true;
            this.mouseEnabled = true;
            this.mouseChildren = true;
            this._txtExpandTitle.visible = true;
            this._txtUnExpandTitle.visible = false;
            return;
        }// end function

        override public function updateData(param1:Object) : void
        {
            this._titleText = param1.label;
            return;
        }// end function

        override public function setSize(param1:Number, param2:Number) : void
        {
            this._txtExpandTitle.width = param1;
            this._txtUnExpandTitle.width = param1;
            this._btnBg.setSize(param1, param2);
            return;
        }// end function

        override public function unexpand() : void
        {
            super.isExpanding = false;
            this._btnBg.enabled = true;
            this._txtExpandTitle.visible = false;
            this._txtUnExpandTitle.visible = true;
            return;
        }// end function

        override public function set dataProvider(param1:DataProvider) : void
        {
            super.dataProvider = param1;
            this._txtExpandTitle.text = this._titleText;
            this._txtUnExpandTitle.text = this._txtExpandTitle.text;
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._btnBg = UIFactory.gLoadingButton(ResFileConst.MarketCatogeryBtn, 0, 0, 128, 23, this);
            var _loc_1:* = GlobalStyle.textFormatPutong;
            _loc_1.align = TextFormatAlign.CENTER;
            _loc_1.size = 14;
            _loc_1.color = 16707564;
            this._txtExpandTitle = UIFactory.gTextField("", 0, -2, 180, 22, this, _loc_1);
            _loc_1 = GlobalStyle.textFormatPutong;
            _loc_1.align = TextFormatAlign.CENTER;
            this._txtUnExpandTitle = UIFactory.gTextField("", 0, 1, 180, 22, this, _loc_1);
            this._txtExpandTitle.mouseEnabled = false;
            this._txtUnExpandTitle.mouseEnabled = false;
            this._txtExpandTitle.visible = false;
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._btnBg.dispose(param1);
            this._btnBg = null;
            this._txtExpandTitle.dispose(param1);
            this._txtExpandTitle = null;
            this._txtUnExpandTitle.dispose(param1);
            this._txtUnExpandTitle = null;
            return;
        }// end function

    }
}
